package com.ccb.lms.service;

import java.sql.SQLException;
import java.util.List;

import com.ccb.lms.facade.FacadeDAO;
import com.ccb.lms.model.LibraryAdmin;
import com.ccb.lms.model.Reader;
import com.ccb.lms.util.BasePage;

public class LibraryAdminService implements ILibraryAdminService {
	private FacadeDAO facadeDAO = null;

	
	public FacadeDAO getFacadeDAO() {
		return facadeDAO;
	}

	public void setFacadeDAO(FacadeDAO facadeDAO) {
		this.facadeDAO = facadeDAO;
	}

	public boolean isLogin(LibraryAdmin libraryAdmin) throws SQLException {
		return facadeDAO.getLibraryAdminDAO().isLogin(libraryAdmin);
	}

	public boolean insertLibraryAdmin(LibraryAdmin libraryAdmin)
			throws SQLException {
		return facadeDAO.getLibraryAdminDAO().insertLibraryAdmin(libraryAdmin);
	}

	public boolean deleteLibraryAdmin(Integer libraryAdminNO)
			throws SQLException {
		return facadeDAO.getLibraryAdminDAO().deleteLibraryAdmin(libraryAdminNO);
	}

	public boolean updateLibraryAdmin(LibraryAdmin libraryAdmin)
			throws SQLException {
		return facadeDAO.getLibraryAdminDAO().updateLibraryAdmin(libraryAdmin);
	}

	public List<LibraryAdmin> getAllLibraryAdmins() throws SQLException {
		return facadeDAO.getLibraryAdminDAO().getAllLibraryAdmins();
	}

	public LibraryAdmin getLibraryAdminByID(String libraryAdminID)
			throws SQLException {
		return facadeDAO.getLibraryAdminDAO().getLibraryAdminByID(libraryAdminID);
	
	}

	public int getLibraryAdminCount() throws SQLException {
		return facadeDAO.getLibraryAdminDAO().getLibraryAdminCount();
	}

	public BasePage getBasePage(int currentPage, int showRecordNum)
			throws SQLException {
		return facadeDAO.getLibraryAdminDAO().getBasePage(currentPage, showRecordNum);
	}

	public List<LibraryAdmin> getLibraryAdminByPage(BasePage basePage)
			throws SQLException {
		return facadeDAO.getLibraryAdminDAO().getLibraryAdminByPage(basePage);
	}

}
